﻿<Application
    x:Class="Win8CalendarDemo.App"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d"
    xmlns:local="using:Win8CalendarDemo" xmlns:Win8Controls="using:Win8Controls">

    <Application.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>

                <!-- 
                    Styles that define common aspects of the platform look and feel
                    Required by Visual Studio project and item templates
                 -->
                <ResourceDictionary Source="Common/StandardStyles.xaml"/>
            </ResourceDictionary.MergedDictionaries>

            <Style TargetType="Win8Controls:CalendarItem">
                <Setter Property="Foreground"  Value="White"/>
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate  TargetType="Win8Controls:CalendarItem">
                            <Grid x:Name="root" d:DesignWidth="272" d:DesignHeight="246" Margin="3,3,3,5">
                                <VisualStateManager.VisualStateGroups>
                                    <VisualStateGroup x:Name="Orientation">
                                        <VisualState x:Name="FullScreenLandscape"/>
                                        <VisualState x:Name="FullScreenPortrait"/>
                                        <VisualState x:Name="Snapped">
                                            <Storyboard>
                                                <DoubleAnimation Duration="0" To="10" Storyboard.TargetProperty="(TextBlock.FontSize)" Storyboard.TargetName="DayNumberBlock" d:IsOptimized="True"/>
                                                <DoubleAnimation Duration="0" To="10" Storyboard.TargetProperty="(TextBlock.FontSize)" Storyboard.TargetName="ExtraText" d:IsOptimized="True"/>
                                                <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(Border.CornerRadius)" Storyboard.TargetName="border1">
                                                    <DiscreteObjectKeyFrame KeyTime="0">
                                                        <DiscreteObjectKeyFrame.Value>
                                                            <CornerRadius>2</CornerRadius>
                                                        </DiscreteObjectKeyFrame.Value>
                                                    </DiscreteObjectKeyFrame>
                                                </ObjectAnimationUsingKeyFrames>
                                                <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(Border.CornerRadius)" Storyboard.TargetName="border">
                                                    <DiscreteObjectKeyFrame KeyTime="0">
                                                        <DiscreteObjectKeyFrame.Value>
                                                            <CornerRadius>2</CornerRadius>
                                                        </DiscreteObjectKeyFrame.Value>
                                                    </DiscreteObjectKeyFrame>
                                                </ObjectAnimationUsingKeyFrames>
                                                <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(Border.CornerRadius)" Storyboard.TargetName="glow">
                                                    <DiscreteObjectKeyFrame KeyTime="0">
                                                        <DiscreteObjectKeyFrame.Value>
                                                            <CornerRadius>2</CornerRadius>
                                                        </DiscreteObjectKeyFrame.Value>
                                                    </DiscreteObjectKeyFrame>
                                                </ObjectAnimationUsingKeyFrames>
                                                <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(Border.CornerRadius)" Storyboard.TargetName="shine">
                                                    <DiscreteObjectKeyFrame KeyTime="0">
                                                        <DiscreteObjectKeyFrame.Value>
                                                            <CornerRadius>2</CornerRadius>
                                                        </DiscreteObjectKeyFrame.Value>
                                                    </DiscreteObjectKeyFrame>
                                                </ObjectAnimationUsingKeyFrames>
                                                <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(FrameworkElement.Margin)" Storyboard.TargetName="DayNumberBlock">
                                                    <DiscreteObjectKeyFrame KeyTime="0">
                                                        <DiscreteObjectKeyFrame.Value>
                                                            <Thickness>0,0,2,2</Thickness>
                                                        </DiscreteObjectKeyFrame.Value>
                                                    </DiscreteObjectKeyFrame>
                                                </ObjectAnimationUsingKeyFrames>
                                            </Storyboard>
                                        </VisualState>
                                        <VisualState x:Name="Filled"/>
                                    </VisualStateGroup>
                                </VisualStateManager.VisualStateGroups>
                                <Border x:Name="border1" BorderThickness="1,1,1,1" CornerRadius="30">
                                    <Border x:Name="border" BorderBrush="#FF000000" BorderThickness="1,1,1,1" CornerRadius="30">
                                        <Border.Background>
                                            <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                                <GradientStop Color="#FF17099E"/>
                                                <GradientStop Color="#FF0B1579" Offset="1"/>
                                                <GradientStop Color="#FF4542A1" Offset="0.4"/>
                                                <GradientStop Color="#FF2E32DE" Offset="0.7"/>
                                            </LinearGradientBrush>
                                        </Border.Background>
                                        <Grid x:Name="grid">
                                            <Grid.RowDefinitions>
                                                <RowDefinition Height="0.5*"/>
                                                <RowDefinition Height="0.5*"/>
                                            </Grid.RowDefinitions>
                                            <Border Opacity="0" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" x:Name="glow" Grid.RowSpan="2" CornerRadius="30">
                                                <Border.Background>
                                                    <LinearGradientBrush>
                                                        <GradientStop Color="#B22072E4" Offset="0"/>
                                                        <GradientStop Color="#001733E6" Offset="1"/>
                                                        <GradientStop Color="#5A000002" Offset="0.4"/>
                                                        <GradientStop Color="#472844AC" Offset="0.7"/>
                                                    </LinearGradientBrush>
                                                </Border.Background>
                                            </Border>
                                            <Border VerticalAlignment="Stretch" HorizontalAlignment="Stretch" 
                                            Margin="0,0,0,0" x:Name="shine" CornerRadius="30" Grid.RowSpan="2">
                                                <Border.Background>
                                                    <LinearGradientBrush EndPoint="0.5,0.9" StartPoint="0.5,0.0">
                                                        <GradientStop Color="#7F85A2CA" Offset="0"/>
                                                        <GradientStop Color="#7F1D1577" Offset="1"/>
                                                        <GradientStop Color="#7FA6BCDB" Offset="0.4"/>
                                                        <GradientStop Color="#7F8196C1" Offset="0.6"/>
                                                        <GradientStop Color="#7F314D7A" Offset="0.8"/>
                                                        <GradientStop Color="#7FB5C9E6" Offset="0.2"/>
                                                    </LinearGradientBrush>
                                                </Border.Background>
                                            </Border>
                                            <TextBlock 
                                    	        x:Name="DayNumberBlock"
                                    	        Text="{Binding DayNumber, RelativeSource={RelativeSource Mode=TemplatedParent}}" 
                                    	        Foreground="White" 
                                    	        FontWeight="ExtraBold"
                                    	        FontSize="40"
                                    	        HorizontalAlignment="Right" 
                                    	        VerticalAlignment="Bottom" 
                                    	        Margin="0,0,10,10"
                                    	        Grid.Row="1"/>
                                            <TextBlock 
                                                x:Name="ExtraText"
                                    	        Text="{Binding RandomTest}" 
                                    	        Foreground="Red" 
                                    	        FontWeight="ExtraBold"
                                    	        FontSize="30"
                                    	        HorizontalAlignment="Left" 
                                    	        VerticalAlignment="Top" 
                                    	        Margin="0,0,10,10"
                                    	        Grid.Row="0" Grid.RowSpan="2"/>
                                        </Grid>
                                    </Border>
                                </Border>
                            </Grid>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </Style>
        </ResourceDictionary>

    </Application.Resources>
</Application>
